@extends('layouts.app')

@section('title', translate('我的订单'))
@section('content')
@include('common.header', ['title'=> translate('我的订单')])

<link rel="stylesheet" href="/fontpage/css/cart_check.css">
<link rel="stylesheet" href="/fontpage/css/animate.css">
<style>
        .action {
            border-bottom: 2px solid #ee4b02;
            color: #ee4b02 !important;
        }
    </style>
    <link rel="stylesheet" href="/fontpage/css/new_main1.css">
<div class="step_Tab border-1px">
    <div class="s-item">
        <div class="sitem-l action ">
            {{translate('待付款')}}
        </div>

        <div class="sitem-l">
           {{translate('待收货')}}

        </div>
        <div class="sitem-l">
            {{translate('待审核')}}

        </div>
        <div class="sitem-l">
            {{translate('已完成')}}
        </div>
        <div class="sitem-l">
            {{translate('待发货')}}
        </div>
    </div>
</div>
<div class="tab1">
	<!-- 选项卡1 -->
	<div class="nav_coupon_none" id="pay">
		<div>
		<div class="lists">
		@include('user.orderlist', ['pageList' => $pageList])
		</div>


			<div class="ajaxMore"><a data-page="2">{{translate('点击加载更多')}}</a></div>
		</div>
	</div>

	<!-- 选项卡2 -->
	<div class="nav_coupon_none"
		style="text-align: center; line-height: 20px; display: none;"
		id="sure">
		<div>
<div class="lists"></div>
			<div class="ajaxMore"><a data-page="2">{{translate('点击加载更多')}}</a></div>
		</div>
	</div>
	<!-- 选项卡3 -->
	<div class="nav_coupon_none"
		style="text-align: center; line-height: 20px; display: none;"
		id="send">
		<div>
		<div class="lists"></div>
			<div class="ajaxMore"><a data-page="2">{{translate('点击加载更多')}}</a></div>
		</div>
	</div>
	<!-- 选项卡4 -->
	<div class="nav_coupon_none"
		style="text-align: center; line-height: 20px; display: none;"
		id="receive">
		<div>
		<div class="lists"></div>
			<div class="ajaxMore"><a data-page="2">{{translate('点击加载更多')}}</a></div>
		</div>
	</div>
	<!-- 选项卡5 -->
	<div class="nav_coupon_none"
		style="text-align: center; line-height: 20px; display: none;"
		id="finish">
		<div>
		<div class="lists"></div>
			<div class="ajaxMore"><a data-page="2">{{translate('点击加载更多')}}</a></div>
		</div>
	</div>
</div>

<script>

    $(function(){
    	window.arr = [1,3,0,4,2]
    	$('.ajaxMore').click(function(){
			ajaxurl("/user/toMyOrder?jp={{request()->get('jp', 0)}}", {page:$('.ajaxMore a').attr('data-page'),status: arr[window.indexof], ajax:1}, function(res){
				if(res.view != '' ){
				$('.ajaxMore a').attr('data-page', parseInt(res.current_page)+1)
				$('#goodsList').append(res.view);
					}else{
			layer.msg("{{translate('没有了')}}");
	   					}
		},'get')
	})


    })



function shouhuo(id)
{
  //询问框
  layer.open({
    content: '{{translate("您要确定收货吗？")}}'
    ,btn: ['{{translate("确定")}}', '{{translate("取消")}}']
    ,yes: function(index){
      ajaxurl('',{id:id,type:''}, function(res){
        layer.msg(res.msg)

        setTimeout(function(){  //使用  setTimeout（）方法设定定时2000毫秒
        window.location.reload();//页面刷新
        },2000);
      })
      layer.close(index);
    }
  });

}



</script>
<script>



</script>
<script type="text/javascript">
$(".sitem-l").click(function () {
        $(this).addClass("action").siblings().removeClass("action");
        var index = $(this).index();
        window.indexof = index
        $(".nav_coupon_none").eq(index).show().siblings().hide();

        ajaxurl('/user/toMyOrder?jp={{request()->get('jp', 0)}}',{status: window.arr[index], ajax:1},function(data){
        	$(".nav_coupon_none").eq(index).find('.lists').html(data.view);
console.log($(".nav_coupon_none").eq(index).find('.lists').html())
            }, 'get')
})
</script>
@endsection
@section('footer')
     @include('common.footer')
@stop
